<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>知果汇</title>
    <link href="__STATIC__/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="__STATIC__/admin/css/simple-line-icons.css" rel="stylesheet">
    <link href="__STATIC__/admin/css/font-awesome.min.css" rel="stylesheet">
    <link href="__STATIC__/admin/css/jasny-bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/admin/css/nanoscroller.css">
    <link href="__STATIC__/admin/css/style.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/jquery-ui.css">
    <!--[if lt IE 9]>
    <script src="__STATIC__/admin/js/html5shiv.min.js"></script>
    <script src="__STATIC__/admin/js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        body {
            background-color: #ffffff;
            min-width: 600px;
        }

        .row {
            margin-left: 0px;
            margin-right: 0px;
            min-width: 600px;
        }

        .form .row {
            margin-top: 5px;
        }

        p {
            margin: 0;
        }

        .form .row img {
            width: 128px;
            height: 128px;
            margin-bottom: 5px;
        }

        .formControls {
            padding-right: 10px;
        }

        .radio-box {
            display: inline-block;
            width: 64px;
        }

        .formControls {
            padding-right: 50px;
            position: relative;
        }

        .textarea {
            height: 100px;
            resize: none;
            font-size: 14px;
            padding: 4px;
        }

        .textarea-numberbar {
            position: absolute;
            right: 70px;
            bottom: 5px;
            z-index: 1;
            margin-bottom: 0;
        }
    </style>
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-admin-add">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">订单编号：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="order"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商品名称：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="name"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商品图片：</label>
            <div class="formControls col-xs-9 col-sm-9 skin-minimal">
                <img id="image" src="">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商家店铺：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="seller"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商家收件地址：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="address_seller"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">买家ID：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="username"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">买家收件地址：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="address_username"></p>
            </div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">买家快递单号：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="buyer_post"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">卖家快递单号：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="seller_post"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">交易类型：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="transaction"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">实付款（元）：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="money"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">创建时间：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="time"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">状态：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <p id="static"></p>
            </div>
        </div>
        <div class="row cl"></div>
    </form>
</article>

<script src="__STATIC__/admin/js/jquery.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap.min.js"></script>
<script src="__STATIC__/admin/js/jasny-bootstrap.min.js"></script>
<script src="__STATIC__/admin/js/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/admin/js/jquery.nanoscroller.min.js"></script>
<script src="__STATIC__/admin/js/metismenu.min.js"></script>
<script src="__STATIC__/admin/js/float-custom.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/laypage/laypage.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/laydata/laydate.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/getMyDate.js"></script>
<script type="text/javascript">
    var url = window.location.href;
    id = url.split("#")[1];
    $.ajax({
        type: 'GET',
        url: "{:url('api/orders/orders_msg')}",
        dataType: 'jsonp',
        jsonp: 'callback',
        data: {id: id},
        success: function (msg) {
            if (msg.code == 200) {
                var time = msg.data.time;
                ltime = getMyDate(time * 1000);

                $("#order").html(msg.data.order);
                $("#name").html(msg.data.name);
                if (msg.data.services == 1) {
					$(".row").eq(4).hide();
					$(".row").eq(7).hide();
					if(msg.data.address == false){
						$("#address_username").html('暂无');	
					}else{
						$("#address_username").html(msg.data.address);
					}
					if(msg.data.seller_e != ''){
						$("#seller_post").html(msg.data.seller_e);
					}else{
						$("#seller_post").html('暂无');	
					}
					
                    $("#image").attr('src', "/Images/tradingMarket/" + msg.data.image);
					if (msg.data.status == 1 && msg.data.static == 1) {
						$("#static").html("买家已提交订单，等待选择买家");
					}  else if (msg.data.status == 2 && msg.data.static == 1) {
						$("#static").html("已选择买家，等待买家付款");
					} else if (msg.data.status == 3 && msg.data.static == 1 && msg.data.index == 0) {
						$("#static").html("买家已付款，等待商家上传专利文件");
					}  else if (msg.data.status == 3 && msg.data.static == 1 && msg.data.index != 0) {
						$("#static").html("等待确认文件或商家再次上传专利文件");
					}else if (msg.data.status == 4 && msg.data.static == 1) {
						$("#static").html("专利文件已上传，等待买家下载");
					} else if (msg.data.statuc == 5 && msg.data.static == 1) {
						$("#static").html("买家文件下载成功,待确认文件");
					} else if (msg.data.status == 5 && msg.data.static == 1) {
						$("#static").html("买家已确认，等待商家上传快递单号");
					} else if (msg.data.status == 6 && msg.data.static == 1) {
						$("#static").html("快递单号已上传，等待买家确认收货");
					} else if (msg.data.status == 7 && (msg.data.static == 4 || msg.data.static == 1)) {
						$("#static").html("买家已确认收货等待平台打款商家");
					} else if (msg.data.status == 8 && (msg.data.static == 4 || msg.data.static == 1)) {
						$("#static").html("平台已打款，等待商家确认收款");
					} else if (msg.data.status == 9 && (msg.data.static == 4 || msg.data.static == 1)) {
						$("#static").html("商家已确认收款，订单已完成");
					} else if (msg.data.status == 10 && msg.data.static == 1) {
						$("#static").html("买家14个自然日内没有付款，订单取消");
					} else if (msg.data.status == 11 && msg.data.static == 1) {
						$("#static").html("长时间未操作,订单取消");
					} else if (msg.data.status == 12 && msg.data.static == 1) {
						$("#static").html("买家取消订单");
					} else if (msg.data.status == 13 && msg.data.static == 3) {
						$("#static").html("退款成功，订单结束");
					}else if (msg.data.static == 2) {
						$("#static").html("申诉成功，待退款");
					}
                }else{
					$("#address_username").html(msg.data.e_lo+msg.data.e_ad);
                    $("#image").attr('src', "/Images/serviceGoods/" + msg.data.image);
					$("#static").html(msg.data.list_name);
					if (msg.data.status == 1 && msg.data.static == 1) {
						$("#static").html("买家已提交订单，等待选择买家");
					}  else if (msg.data.status == 9 && msg.data.static == 4) {
						$("#static").html("待卖家确认收款");
					}else if (msg.data.status == 10 && msg.data.static == 4) {
						$("#static").html("订单已完成");
					}
                }
                $("#seller").html(msg.data.seller);
                $("#address_seller").html(msg.data.f_lo+msg.data.f_ad);
                $("#username").html(msg.data.username);
				$("#buyer_post").html(msg.data.username_e);
				$("#seller_post").html(msg.data.seller_e);
				
                
				
                $("#transaction").html(msg.data.transaction);
                $("#time").html(ltime);
                if (msg.data.money == '0.00') {
                    $("#money").html('待选择');
                }else{
					$("#money").html(msg.data.money);
				}
				
            } else {
                layer.msg('获取信息不成功!', {icon: 5, time: 2000});
            }
        }
    })
</script>
</body>
</html>